package com.ruoyi.recycle.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.recycle.domain.HomePageSlideshow;
import com.ruoyi.recycle.mapper.HomePageSlideshowMapper;
import com.ruoyi.recycle.service.IHomePageSlideshowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 首页轮播广告图片Service业务层处理
 *
 * @author Wubk
 * @date 2022-05-22
 */
@Service
public class HomePageSlideshowServiceImpl extends ServiceImpl<HomePageSlideshowMapper, HomePageSlideshow> implements IHomePageSlideshowService {
    @Autowired
    private HomePageSlideshowMapper homePageSlideshowMapper;

    /**
     * 查询首页轮播广告图片
     *
     * @param id 首页轮播广告图片主键
     * @return 首页轮播广告图片
     */
    @Override
    public HomePageSlideshow selectHomePageSlideshowById(Long id) {
        return homePageSlideshowMapper.selectHomePageSlideshowById(id);
    }

    /**
     * 查询首页轮播广告图片列表
     *
     * @param homePageSlideshow 首页轮播广告图片
     * @return 首页轮播广告图片
     */
    @Override
    public List<HomePageSlideshow> selectHomePageSlideshowList(HomePageSlideshow homePageSlideshow) {
        return homePageSlideshowMapper.selectHomePageSlideshowList(homePageSlideshow);
    }

    /**
     * 新增首页轮播广告图片
     *
     * @param homePageSlideshow 首页轮播广告图片
     * @return 结果
     */
    @Override
    public int insertHomePageSlideshow(HomePageSlideshow homePageSlideshow) {
        return homePageSlideshowMapper.insertHomePageSlideshow(homePageSlideshow);
    }

    /**
     * 修改首页轮播广告图片
     *
     * @param homePageSlideshow 首页轮播广告图片
     * @return 结果
     */
    @Override
    public int updateHomePageSlideshow(HomePageSlideshow homePageSlideshow) {
        return homePageSlideshowMapper.updateHomePageSlideshow(homePageSlideshow);
    }

    /**
     * 批量删除首页轮播广告图片
     *
     * @param ids 需要删除的首页轮播广告图片主键
     * @return 结果
     */
    @Override
    public int deleteHomePageSlideshowByIds(Long[] ids) {
        return homePageSlideshowMapper.deleteHomePageSlideshowByIds(ids);
    }

    /**
     * 删除首页轮播广告图片信息
     *
     * @param id 首页轮播广告图片主键
     * @return 结果
     */
    @Override
    public int deleteHomePageSlideshowById(Long id) {
        return homePageSlideshowMapper.deleteHomePageSlideshowById(id);
    }
}
